package com.party.core.model.member;

/**
 * @ClassName ScanLoginStatus
 * @Description 扫描登录状态枚举
 * @Author yifeng
 * @Date 2019/2/15 11:59
 **/
public enum ScanLoginStatus {
    NOT_SCAN(10000, "未扫描"),

    SCAN_SUCCESS(10001, "扫描成功"),

    SCAN_SUCCESS_CONFIRM(100011, "扫描成功-确认登录"),

    SCAN_SUCCESS_CANCEL(100012, "扫描成功-取消登录"),

    QR_INVALID(10002, "已失效"),

    SCAN_SUCCESS_LOGIN(10003, "登录成功");

    //状态码
    private Integer code;

    //状态值
    private String value;

    ScanLoginStatus(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValue(Integer code) {
        for (ScanLoginStatus roleType : ScanLoginStatus.values()) {
            if (roleType.getCode().equals(code)) {
                return roleType.getValue();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
